{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/modules/ChangeProfileForm/components/ChangeProfileForm.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport { Controller, useForm, useFormState } from \"react-hook-form\";\nimport { nicknameValidation, passwordValidation, confirmPassword } from '../../validation';\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport AlternateEmailOutlinedIcon from \"@mui/icons-material/AlternateEmailOutlined\";\nimport VpnKeyOutlinedIcon from \"@mui/icons-material/VpnKeyOutlined\";\nimport Button from \"../../../components/Button\";\nimport styles from \"../../Form.module.scss\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst ChangeProfileForm = _ref => {\n  _s();\n  let {\n    profile\n  } = _ref;\n  const {\n    handleSubmit,\n    control,\n    watch\n  } = useForm();\n  const {\n    errors\n  } = useFormState({\n    control\n  });\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: styles.authForm,\n    children: [/*#__PURE__*/_jsxDEV(Typography, {\n      variant: \"h4\",\n      component: \"div\",\n      className: styles.authFormTitle,\n      children: \"\\u0418\\u0437\\u043C\\u0435\\u043D\\u0435\\u043D\\u0438\\u0435 \\u043F\\u0440\\u043E\\u0444\\u0430\\u0439\\u043B\\u0430\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 21,\n      columnNumber: 13\n    }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n      className: styles.authForm__form,\n      onSubmit: () => console.log(13),\n      children: [/*#__PURE__*/_jsxDEV(Controller, {\n        control: control,\n        name: \"nickname\",\n        rules: nicknameValidation,\n        render: _ref2 => {\n          var _errors$nickname, _errors$nickname2;\n          let {\n            field\n          } = _ref2;\n          return /*#__PURE__*/_jsxDEV(TextField, {\n            label: \"\\u041F\\u0441\\u0435\\u0432\\u0434\\u043E\\u043D\\u0438\\u043C\",\n            InputProps: {\n              endAdornment: /*#__PURE__*/_jsxDEV(AlternateEmailOutlinedIcon, {\n                className: styles.formIcon\n              }, void 0, false, {\n                fileName: _jsxFileName,\n                lineNumber: 35,\n                columnNumber: 37\n              }, this)\n            },\n            onChange: e => field.onChange(e),\n            value: field.value || '',\n            fullWidth: true,\n            size: \"small\",\n            margin: \"normal\",\n            type: \"text\",\n            error: !!((_errors$nickname = errors.nickname) !== null && _errors$nickname !== void 0 && _errors$nickname.message),\n            helperText: (_errors$nickname2 = errors.nickname) === null || _errors$nickname2 === void 0 ? void 0 : _errors$nickname2.message\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 31,\n            columnNumber: 25\n          }, this);\n        }\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 26,\n        columnNumber: 17\n      }, this), /*#__PURE__*/_jsxDEV(Controller, {\n        control: control,\n        name: \"password\",\n        rules: passwordValidation,\n        render: _ref3 => {\n          var _errors$password, _errors$password2;\n          let {\n            field\n          } = _ref3;\n          return /*#__PURE__*/_jsxDEV(TextField, {\n            label: \"\\u041F\\u0430\\u0440\\u043E\\u043B\\u044C\",\n            InputProps: {\n              endAdornment: /*#__PURE__*/_jsxDEV(VpnKeyOutlinedIcon, {\n                className: styles.formIcon\n              }, void 0, false, {\n                fileName: _jsxFileName,\n                lineNumber: 58,\n                columnNumber: 37\n              }, this)\n            },\n            onChange: e => field.onChange(e),\n            value: field.value || '',\n            fullWidth: true,\n            size: \"small\",\n            margin: \"normal\",\n            type: \"password\",\n            helperText: (_errors$password = errors.password) === null || _errors$password === void 0 ? void 0 : _errors$password.message,\n            error: !!((_errors$password2 = errors.password) !== null && _errors$password2 !== void 0 && _errors$password2.message)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 54,\n            columnNumber: 25\n          }, this);\n        }\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 49,\n        columnNumber: 17\n      }, this), /*#__PURE__*/_jsxDEV(Controller, {\n        control: control,\n        name: \"confirmPassword\",\n        rules: confirmPassword(watch('password'), watch('confirmPassword')),\n        render: _ref4 => {\n          var _errors$confirmPasswo, _errors$confirmPasswo2;\n          let {\n            field\n          } = _ref4;\n          return /*#__PURE__*/_jsxDEV(TextField, {\n            label: \"\\u041F\\u043E\\u0432\\u0442\\u043E\\u0440\\u0438\\u0442\\u0435 \\u043F\\u0430\\u0440\\u043E\\u043B\\u044C\",\n            InputProps: {\n              endAdornment: /*#__PURE__*/_jsxDEV(VpnKeyOutlinedIcon, {\n                className: styles.formIcon\n              }, void 0, false, {\n                fileName: _jsxFileName,\n                lineNumber: 81,\n                columnNumber: 37\n              }, this)\n            },\n            onChange: e => field.onChange(e),\n            value: field.value || '',\n            fullWidth: true,\n            size: \"small\",\n            margin: \"normal\",\n            type: \"password\",\n            helperText: (_errors$confirmPasswo = errors.confirmPassword) === null || _errors$confirmPasswo === void 0 ? void 0 : _errors$confirmPasswo.message,\n            error: !!((_errors$confirmPasswo2 = errors.confirmPassword) !== null && _errors$confirmPasswo2 !== void 0 && _errors$confirmPasswo2.message)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 77,\n            columnNumber: 25\n          }, this);\n        }\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 72,\n        columnNumber: 17\n      }, this), /*#__PURE__*/_jsxDEV(Button, {\n        text: 'Применить изменения'\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 95,\n        columnNumber: 17\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 25,\n      columnNumber: 13\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 20,\n    columnNumber: 9\n  }, this);\n};\n_s(ChangeProfileForm, \"S1mW3gEXs/gxjVdI8VdmKYR0UOw=\", false, function () {\n  return [useForm, useFormState];\n});\n_c = ChangeProfileForm;\nexport default ChangeProfileForm;\nvar _c;\n$RefreshReg$(_c, \"ChangeProfileForm\");","map":{"version":3,"names":["React","Controller","useForm","useFormState","nicknameValidation","passwordValidation","confirmPassword","Typography","TextField","AlternateEmailOutlinedIcon","VpnKeyOutlinedIcon","Button","styles","ChangeProfileForm","profile","handleSubmit","control","watch","errors","authForm","authFormTitle","authForm__form","console","log","field","endAdornment","formIcon","e","onChange","value","nickname","message","password"],"sources":["/data/messenger.client/src/modules/ChangeProfileForm/components/ChangeProfileForm.tsx"],"sourcesContent":["import React from 'react';\nimport ProfileRequest from \"../../../models/request/ProfileRequest\";\nimport {UserListItem} from \"../../../models/response/UserListItem\";\nimport {Controller, useForm, useFormState} from \"react-hook-form\";\nimport SignUpRequest from \"../../../models/request/SignUpRequest\";\nimport {nicknameValidation, passwordValidation, confirmPassword} from '../../validation';\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport MailOutlineIcon from \"@mui/icons-material/MailOutline\";\nimport AlternateEmailOutlinedIcon from \"@mui/icons-material/AlternateEmailOutlined\";\nimport VpnKeyOutlinedIcon from \"@mui/icons-material/VpnKeyOutlined\";\nimport Button from \"../../../components/Button\";\nimport styles from \"../../Form.module.scss\";\n\nconst ChangeProfileForm = ({profile} : {profile: UserListItem}) => {\n    const {handleSubmit, control, watch} = useForm<SignUpRequest>();\n    const {errors} = useFormState({control});\n\n    return (\n        <div className={styles.authForm}>\n            <Typography variant=\"h4\" component=\"div\" className={styles.authFormTitle}>\n                Изменение профайла\n            </Typography>\n\n            <form className={styles.authForm__form} onSubmit={() => console.log(13)}>\n                <Controller\n                    control={control}\n                    name=\"nickname\"\n                    rules={nicknameValidation}\n                    render={({ field }) => (\n                        <TextField\n                            label=\"Псевдоним\"\n                            InputProps={{\n                                endAdornment: (\n                                    <AlternateEmailOutlinedIcon className={styles.formIcon}/>\n                                ),\n                            }}\n                            onChange={(e) => field.onChange(e)}\n                            value={field.value || ''}\n                            fullWidth={ true }\n                            size=\"small\"\n                            margin=\"normal\"\n                            type=\"text\"\n                            error={!!errors.nickname?.message}\n                            helperText={errors.nickname?.message}\n                        />\n                    )}\n                />\n                <Controller\n                    control={control}\n                    name=\"password\"\n                    rules={passwordValidation}\n                    render={({ field }) => (\n                        <TextField\n                            label=\"Пароль\"\n                            InputProps={{\n                                endAdornment: (\n                                    <VpnKeyOutlinedIcon className={styles.formIcon}/>\n                                ),\n                            }}\n                            onChange={(e) => field.onChange(e)}\n                            value={field.value || ''}\n                            fullWidth={ true }\n                            size=\"small\"\n                            margin=\"normal\"\n                            type=\"password\"\n                            helperText={errors.password?.message}\n                            error={!!errors.password?.message}\n                        />\n                    )}\n                />\n                <Controller\n                    control={control}\n                    name=\"confirmPassword\"\n                    rules={confirmPassword(watch('password'), watch('confirmPassword'))}\n                    render={({ field }) => (\n                        <TextField\n                            label=\"Повторите пароль\"\n                            InputProps={{\n                                endAdornment: (\n                                    <VpnKeyOutlinedIcon className={styles.formIcon}/>\n                                ),\n                            }}\n                            onChange={(e) => field.onChange(e)}\n                            value={field.value || ''}\n                            fullWidth={ true }\n                            size=\"small\"\n                            margin=\"normal\"\n                            type=\"password\"\n                            helperText={errors.confirmPassword?.message}\n                            error={!!errors.confirmPassword?.message}\n                        />\n                    )}\n                />\n                <Button text={'Применить изменения'} />\n            </form>\n        </div>\n    );\n}\n\nexport default ChangeProfileForm;"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAAQC,UAAU,EAAEC,OAAO,EAAEC,YAAY,QAAO,iBAAiB;AAEjE,SAAQC,kBAAkB,EAAEC,kBAAkB,EAAEC,eAAe,QAAO,kBAAkB;AACxF,OAAOC,UAAU,MAAM,0BAA0B;AACjD,OAAOC,SAAS,MAAM,yBAAyB;AAE/C,OAAOC,0BAA0B,MAAM,4CAA4C;AACnF,OAAOC,kBAAkB,MAAM,oCAAoC;AACnE,OAAOC,MAAM,MAAM,4BAA4B;AAC/C,OAAOC,MAAM,MAAM,wBAAwB;AAAC;AAE5C,MAAMC,iBAAiB,GAAG,QAAyC;EAAA;EAAA,IAAxC;IAACC;EAAiC,CAAC;EAC1D,MAAM;IAACC,YAAY;IAAEC,OAAO;IAAEC;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